﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TiendaMVC3_EF.Models;

namespace TiendaMVC3_EF.Controllers
{
    public class HomeController : Controller
    {
        private NuestroDbContext db = new NuestroDbContext();

        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to ASP.NET MVC!";

            return View(model: db.Productoes.ToList());
        }

        public ActionResult About()
        {
            return View();
        }

        public ActionResult Producto(long id)
        {
            var producto = db.Productoes.Find(id);
            return View(model: producto);
        }

    }
}
